package com.cq.hd.member.controller;

import com.cq.hd.common.pagination.Page;
import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.member.api.TbAgentUnBindApplyApi;
import com.cq.hd.member.api.dto.*;
import com.cq.hd.member.api.vo.AgentUnBindApplyPageVo;
import com.cq.hd.member.service.TbAgentUnBindApplyService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 经纪人解绑申请记录表 前端控制器
 * </p>
 *
 * @author mYunYu
 * @since 2024-01-18
 */
@RestController
public class TbAgentUnBindApplyController implements TbAgentUnBindApplyApi {

    @Autowired
    private TbAgentUnBindApplyService agentUnBindApplyService;

    @ApiOperation(value = "经纪人绑定申请")
    @Override
    public Result<Boolean> apply(AgentUnBindApplyDto agentApplyDto) {
        return ResultGenerator.success(agentUnBindApplyService.apply(agentApplyDto));
    }

    @ApiOperation(value = "待审核数量")
    @Override
    public Result<Integer> waitAuditCount(Long inviterUserId) {
        return ResultGenerator.success(agentUnBindApplyService.waitAuditCount(inviterUserId));
    }

    @ApiOperation(value = "解绑申请列表")
    @Override
    public Result<Page<AgentUnBindApplyPageVo>> page(AgentUnBindApplyPageDto agentUnBindApplyPageDto) {
        return ResultGenerator.success(agentUnBindApplyService.page(agentUnBindApplyPageDto));
    }

    @ApiOperation(value = "解绑审核")
    @Override
    public Result<Boolean> audit(AgentUnBindApplyAuditDto agentUnBindApplyAuditDto) {
        return ResultGenerator.success(agentUnBindApplyService.audit(agentUnBindApplyAuditDto));
    }
}
